import request from '@/utils/request'

// 查询主题文章列表
export function listTopicTitle(query) {
  return request({
    url: '/article/topicTitle/list',
    method: 'get',
    params: query
  })
}
// 查询分类
export function spiderClassSelect() {
  return request({
    url: '/article/diySpider/getSpiderClassTreeData',
    method: 'get'
  })
}

export function outlinesSelect() {
  return request({
    url: '/article/outline/list',
    method: 'get'
  })
}



// 查询主题文章详细
export function getTopicTitle(id) {
  return request({
    url: '/article/topicTitle/' + id,
    method: 'get'
  })
}

// 新增主题文章
export function addTopicTitle(data) {
  return request({
    url: '/article/topicTitle',
    method: 'post',
    data: data
  })
}

// 修改主题文章
export function updateTopicTitle(data) {
  return request({
    url: '/article/topicTitle',
    method: 'put',
    data: data
  })
}

// 删除主题文章
export function delTopicTitle(id) {
  return request({
    url: '/article/topicTitle/' + id,
    method: 'delete'
  })
}
// 生成文章
export function startGen(id) {
  return request({
    url: '/article/topicTitle/startGen/' + id,
    method: 'get'
  })
}

// 生成当前条件下所有文章
export function startGenAll(query,genPs) {
  query.genPs = genPs;
  console.log(query)
  return request({
    url: '/article/topicTitle/tartGenAll/',
    method: 'post',
    data: query
  })
}
